@extends('akl.Admin.Base-index')
@section('content')
<script>
	$('#left-bar .nav>li:nth-child(4)>.menu').addClass('on');
</script>
<div class="main-menu fadeInLeft">
	<div class="title">
		<i class="fa fa-file-text-o"></i> 组成列表
	</div>
	<ul class="act-list">
		<li>
			<a href="{{url('Admin/Composition/create')}}"><i class="fa fa-plus-square-o"></i>添加组成分类</a>
			<a href="{{url('Admin/Content/create')}}"><i class="fa fa-plus-square-o"></i>添加分类内容</a>
		</li>
	</ul>
</div>

<div class="main-wrap fadeInRight">
	@if (count($errors) > 0)
		<div style="color: red">
			<ul>
				@if( is_object($errors) )
					@foreach ($errors->all() as $error)
						<li>{{ $error }}</li>
					@endforeach
				@else
					{{ $errors }}
				@endif
			</ul>
		</div>
	@endif
	<table class="tablePanel2" >
		<tr>
			<th>id</th>
			<th>名称</th>
			<th>logo</th>
			<th>描述</th>
	        <th>操作</th>
		</tr>
		@foreach($composition as $com)
			<tr>
				<td>{{$com->com_id}}</td>
				<td>{{$com->com_name}}</td>
				<td> <img src={{ $com->com_url}} width=30 /> </td>
				<td>{{$com->com_description}}</td>
				<td>
					<a class="act-btn" href="{{url('Admin/Composition/delete/'.$com->com_id)}}" onclick="return confirm('确实要删除吗？')">删除</a>
					<a class="act-btn" href="{{url('Admin/Composition/edit/'.$com->com_id)}}">编辑</a>
					<a class="act-btn" href="{{url('/Admin/Content/look/'.$com->com_id)}}">查看</a>
				</td>
			</tr>
		@endforeach

	</table>
	<div class="pagenav">
		{{--{{ $permission->links() }}--}}
	</div>
</div>

@endsection